#ifndef __MESSMACHINE
#define __MESSMACHINE

#include "Message/ICallback.h"
#pragma warning(disable: 4786)
#include <vector>

class State;
class BaseGameEntity;
//Callbacks for handling messages


class StateMachine
{
public:
	//constructor/functions
	StateMachine(BaseGameEntity* pOwner = NULL);
	void UpdateMachine(float dt);
	void AddState(State* state);
	void SetDefaultState(State* state) {m_defaultState = state;}
	void SetGoalID(int goal) {m_goalID = goal;}
	bool TransitionState(int goal);
	void Reset();
	State* GetCurrentState();
	State* GetState(int type);
	State* GetPrevState(){return m_prevState;}

	
	//data
	int m_type;
protected:
	std::vector<State*> m_states;
	State* m_currentState;
	State* m_defaultState;
	State* m_goalState;
	State* m_prevState;
	int		   m_goalID;
};
#endif